//
//  IHRefreshTableView.h
//  MyProject
//
//  Created by Pei on 16/6/22.
//  Copyright © 2016年 Xiaobo Pei. All rights reserved.
//
#import "IHTableView.h"
#import "MJRefresh.h"

typedef enum{
    RefreshTypeTop = 1<<0,
    RefreshTypeBottom = 1<<1,
}RefreshType;

@protocol IHTableViewRefreshingDelegate;

@interface IHRefreshTableView : IHTableView
{
    BOOL _autoLoad;
}
@property (nonatomic, weak) id<IHTableViewRefreshingDelegate> refreshDelegate;
@property (nonatomic, assign) RefreshType refreshType;

@property (nonatomic, strong) MJRefreshHeaderView *header;
@property (nonatomic, strong) MJRefreshFooterView *footer;

//modify by peixiaobo
@property (nonatomic, assign, getter = isAutoLoad) BOOL autoLoad;
//@property (nonatomic, assign, readonly, getter = isAutoLoad) BOOL autoLoad;

- (id) initWithFrame:(CGRect)frame refreshType:(RefreshType)type;
- (id) initWithFrame:(CGRect)frame refreshType:(RefreshType)type andAutoLoad:(BOOL) autoLoad;
-(id) initWithFrame:(CGRect)frame withStyle:(UITableViewStyle)style refreshType:(RefreshType)type andAutoLoad:(BOOL)autoLoad;
- (void) refreshData;
- (void) loadMore;
- (void) noMoreData;
- (void)DQBListNoMoreData;
- (void)reloadFooterView;

//modify by peixiaobo
- (void) prepareMJRefresh;

@end

@protocol IHTableViewRefreshingDelegate <NSObject>

@optional
- (void) beginRefreshHeader:(IHRefreshTableView*) tableView refreshView:(MJRefreshBaseView*) refreshView;
- (void) beginRefreshFooter:(IHRefreshTableView*) tableView refreshView:(MJRefreshBaseView*) refreshView;
- (void) refreshStateDidChange:(IHRefreshTableView*) tableView refreshState:(MJRefreshState) refreshState;
- (void) endRefreshHeader:(IHRefreshTableView *) tableView refreshView:(MJRefreshBaseView*) refreshView;


@end
